pkgname=vdr-osdteletext
pkgver=0.5.1
pkgrel=2
arch=('i686')
pkgdesc="A teletext-as-OSD plugin for VDR"
url="http://www.wiesweg-online.de/linux/linux.html"
license=('GPL')
depends=('vdr' 'gcc')
install=vdr-osdteletext.install
source=(http://www.wiesweg-online.de/linux/vdr/$pkgname-$pkgver.tgz \
	osdteletext-dir.diff osdteletext-pl.diff)
md5sums=('52c219e38a089504071237209ad114cd'
         '0ec3b07c77528566e4d19e1aeb1bed87'
         'f27ab21f31d803156e58199ac0a49ab9')

build() {
  cd $startdir/src/osdteletext-$pkgver

  patch -Np1 -i $startdir/src/osdteletext-dir.diff || return 1
  patch -Np1 -i $startdir/src/osdteletext-pl.diff || return 1

  sed -i \
	 -e 's:@cp $@ :install -D -m 755 $@ $(DESTDIR):' \
	 -e 's:../../man:man:' \
	 -e 's:VDRVERSION:APIVERSION:g' \
	 Makefile
  make VDRDIR=/usr/include/vdr LIBDIR=/usr/lib/vdr DESTDIR=$startdir/pkg all || return 1

  install -m 775 -d $startdir/pkg/var/cache/osdteletext
}
